package com.example.demo.java8.functionalinterface;

import com.example.demo.java8.model.Emp;

import java.util.function.Supplier;

/**
 * JAVA8 Supplier接口
 *
 * @author luowj12
 * @since 2021/5/10 16:02
 */
public class SupplierTest {

    public static void main(String[] args) {
        Supplier<String> supplier = String::new;
        System.out.println(supplier.get());//""
        Supplier<Emp> supplierEmp = Emp::new;
        Emp emp = supplierEmp.get();
        emp.setName("dd");
        System.out.println(emp.getName());//dd

    }

}
